import React from 'react';
import { messages } from 'share/common';
import { Col, InputNumber, Row, Select } from 'antd';
import { drivingPlanValueChild } from 'containers/expense-reimbursement-control/new-mileage-subsidy/dataSources';

export class ReferenceMileage extends React.Component {

  static PropTypes = { drivingPlanValue: React.PropTypes.number, value: React.PropTypes.number };

  render() {
    const { drivingPlanValue, value } = this.props;
    return (
      <Row className="reference-mileage">
        <Col span={8}>
          <Select className="reference-mileage__select" defaultValue={drivingPlanValue === void 0 ? 10 : drivingPlanValue} disabled>
            {drivingPlanValueChild.map(item => <option value={item.value}>{item.name}</option>)}
          </Select>
        </Col>
        <Col span={16}>
          <InputNumber
            min={0}
            size="middle"
            value={value}
            style={{ width: '100%' }}
            disabled
            className="reference-mileage__input"
            precision={2}
            placeholder={messages('expense-12.key1')/*输入出发目的地点后自动计算*/}
          />
        </Col>
      </Row>
    );
  }
}
